#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<vector>

using namespace std;

int minimumLevels(vector<int>& possible) {
    int count = 0;
    for (auto it : possible)
        if (it == 0) count++;

    int n = possible.size();
    int t1 = 0, t2 = 0;
    for (int i = 0; i < n - 1; i++)
    {
        if (possible[i] == 0)    t2++;
        else t1++;

        if (2 * t1 - 2 * t2 > n - 2 * count) return i + 1;
    }
    return -1;
}

int main()
{

	return 0;
}